package book;

public class BookList {
    private Book[] books=new Book[10];//初始化书
    private int  userSize;//书的个数

    public void setBooks(Book books) {//增加新书
        this.books[userSize] = books;
    }
    public void setUserSize(int userSize) {
        this.userSize = userSize;
    }
    public void setBooks(Book books,int size) {

        this.books[size] = books;
    }

    public int getUserSize() {
        return userSize;
    }

    public Book getBooks(int pos) {
        return books[pos];
    }


    public BookList(){
        books[0]=new Book("三国演义","罗贯中",18,"小说");
        books[1]=new Book("西游记","吴承恩",18,"小说");
        books[2]=new Book("红楼梦","曹雪芹",18,"小说" );
        this.userSize=3;
    }
}
